package com.chenshuang.service;

import com.chenshuang.bean.CartGoods;
import com.chenshuang.bean.Goods;


import com.chenshuang.dao.GoodsDao;
import com.chenshuang.dao.CartGoodsDao;

import java.util.List;

public class GoodsService {

    GoodsDao goodsDao = new GoodsDao();
    CartGoodsDao cartgoodsDao = new CartGoodsDao();


    public List<Goods> queryAll() {

        return goodsDao.queryAll();
    }

    public Goods queryGoods(String id) {
        return goodsDao.queryGoods(id);
    }

    // 根据id查询VirGoods层 并把查询到的 商品结果 返回给外层的对象
    public CartGoods queryGoods(String id ,CartGoods cartgoods) {
        return  cartgoodsDao.queryGoods(id,cartgoods);
    }


    public Goods queryvirGoods1(String id) {
        return cartgoodsDao.queryGoods1(id);
    }
}
